<script src="https://unpkg.com/flyio/dist/fly.min.js">
</script>
<script src="https://cdn.bootcss.com/layer/3.1.0/mobile/layer.js"></script>
<script type="text/javascript">
function upload() {

}

function request(url, param, success, fail) {
    layer.open({ type: 2 });
    fly.request(url, param, {
            method: "get"
        })
        .then(function(response) {
            console.log(response);

            // layer.open({
            //     content: '移动版和PC版不能同时存在同一页面',
            //     btn: '我知道了'
            // });
            layer.closeAll();
            var data = response.data
            var status = data.status

            if (status == 200) {
                success(data)
            } else {
                var msg = response.data.msg
                layer.open({
                    content: msg,
                    btn: '我知道了'
                });
            }
        })
        .catch(function(error) {
            console.log(error);
            layer.closeAll();
            var msg = '出错啦~'
            message(msg);
        });
}

function message(msg) {
    layer.open({
        content: msg,
        skin: 'msg',
        time: 3 //2秒后自动关闭
    });
}

function remind(msg) {
    layer.open({
        content: msg,
        btn: '确定'
    });
}
</script>